/* eslint-disable no-unused-vars */
import { PromiseResponse } from '@/types/type'
import { AddressType, RegionType } from './type'
import { request } from '@/utils/request'
import { QueryFormType } from '@/types/queryform'

enum API {
    GET_REGIONS = '/region/getRegions',
    GET_ALL_REGIONS = '/region/getAll',
}
export const getRegions = (): PromiseResponse<AddressType[]> => request(API.GET_REGIONS)
export const getAllRegions = (queryForm?: QueryFormType<any>): PromiseResponse<RegionType[]> => {
    return request(API.GET_ALL_REGIONS, 'GET', {}, queryForm)
}
